﻿Namespace ScriptingHost

    Public Class CompilationErrorListener
        Inherits Microsoft.Scripting.Hosting.ErrorListener

        Public Property Source() As ScriptTask
        Public Property Handler() As EventHandler(Of CompilationErrorEventArgs)

        Public Sub New(ByVal spt As ScriptTask, ByVal handler As EventHandler(Of CompilationErrorEventArgs))
            Me.Source = spt
            Me.Handler = handler
        End Sub

        Public Overrides Sub ErrorReported(source As Microsoft.Scripting.Hosting.ScriptSource, message As String, span As Microsoft.Scripting.SourceSpan, errorCode As Integer, severity As Microsoft.Scripting.Severity)
            Me.Handler.Invoke(Me, New CompilationErrorEventArgs(source, message, span, errorCode, severity))
        End Sub

    End Class

End Namespace